﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
#define MAX 100
int main()
{
	int num = 0, music[MAX] = { 0 }, sign[MAX] = { 0 },sum = 0;
	printf("输入需要听得歌曲数量：\n>");
	scanf("%d", &num);
	for (int i = 0; i < num; i++)
	{
		scanf("%d %d", &music[i], &sign[i]);
		if (sign[i] == 0)sum += 10;
		else sum += music[i];
	}
	printf("sum = %d", sum);
	return 0;
}